#ifndef GRAPHICSSUBCLASS_H
#define GRAPHICSSUBCLASS_H

#include <QGraphicsView>
#include <QMouseEvent>
#include <QContextMenuEvent>
#include <QMenu>
class GraphicsSubClass : public QGraphicsView
{
    Q_OBJECT
public:
    explicit GraphicsSubClass(QWidget *parent = 0);

     void startDrawing(bool isDraw, int i);
signals:
     void getPointForLine(QPoint *p0, QPoint *p1);
     void getPointForRect(QPoint *p0, QPoint *p1);
     void getPointForBezier(QPoint *p0, QPoint *p1,QPoint *p2, QPoint *p3);
     void clearMyScreen();
     void clearMySelection();
public slots:

protected:
    void mousePressEvent(QMouseEvent *event);
    void mouseReleaseEvent(QMouseEvent *event);
    void mouseMoveEvent(QMouseEvent *event);
    void contextMenuEvent(QContextMenuEvent *event);

private:
    enum myDrawing {DrawLine=1,DrawRect=2,DrawCubicBezier=3,DrawQuadBezier=4};
    myDrawing obj1;
    bool drawingOn;
    int whtToDraw;
    int count;
    QPoint *p0,*p1,*p2,*p3;

    QAction *clearScreen, *clearSelection;
    void initContextMenus();
};

#endif // GRAPHICSSUBCLASS_H
